package com.etc.reflectdemo.entity;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author: knowno
 * @create: 2024-09-18 14:40
 * @Version 1.0
 **/
public class Book  implements Serializable {
    private String ISBN;
    private int typeId;
    private String bookname;
    private String writer;
    private String translator;
    private String publisher;
    private LocalDateTime date;
    private double price;

    @Override
    public String toString() {
        return "Book{" +
                "ISBN='" + ISBN + '\'' +
                ", typeId=" + typeId +
                ", bookname='" + bookname + '\'' +
                ", writer='" + writer + '\'' +
                ", translator='" + translator + '\'' +
                ", publisher='" + publisher + '\'' +
                ", date='" + date + '\'' +
                ", price=" + price +
                '}';
    }

    public String getISBN() {
        return ISBN;
    }

    public void setISBN(String ISBN) {
        this.ISBN = ISBN;
    }

    public int getTypeId() {
        return typeId;
    }

    public void setTypeId(int typeId) {
        this.typeId = typeId;
    }

    public String getBookname() {
        return bookname;
    }

    public void setBookname(String bookname) {
        this.bookname = bookname;
    }

    public String getWriter() {
        return writer;
    }

    public void setWriter(String writer) {
        this.writer = writer;
    }

    public String getTranslator() {
        return translator;
    }

    public void setTranslator(String translator) {
        this.translator = translator;
    }

    public String getPublisher() {
        return publisher;
    }

    public void setPublisher(String publisher) {
        this.publisher = publisher;
    }

    public LocalDateTime getDate() {
        return date;
    }

    public void setDate(LocalDateTime date) {
        this.date = date;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    private  BookType bookType = new BookType();

    public BookType getBookType(){
        return  this.bookType;
    }

    public void setTypeName(String typeName) {
        //这里setTypeName的方法，表示有一个 内省机制的 方案=》typeName的属性
        System.out.println("setTypeName : "+typeName);
        this.bookType.setTypeName(typeName);
    }

}
